package org.whuims.pois.model;

import org.apache.struts.action.ActionForm;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by zhongwei on 2014/5/13.
 */
@Entity
@Table(name = "topic_c")
public class TopicC extends ActionForm{
    private long id;
    private String name;
    private String description;
    private Timestamp addTime;
    private Timestamp startTime;
    private int status;
    private String keywords;
    private String excludeWords;
    private String tableSuffix;
    private String saveRoot;

    @Id
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "addTime")
    public Timestamp getAddTime() {
        return addTime;
    }

    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "startTime")
    public Timestamp getStartTime() {
        return startTime;
    }

    public void setStartTime(Timestamp startTime) {
        this.startTime = startTime;
    }

    @Basic
    @Column(name = "status")
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Basic
    @Column(name = "keywords")
    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    @Basic
    @Column(name = "excludeWords")
    public String getExcludeWords() {
        return excludeWords;
    }

    public void setExcludeWords(String excludeWords) {
        this.excludeWords = excludeWords;
    }

    @Basic
    @Column(name = "tableSuffix")
    public String getTableSuffix() {
        return tableSuffix;
    }

    public void setTableSuffix(String tableSuffix) {
        this.tableSuffix = tableSuffix;
    }

    @Basic
    @Column(name = "saveRoot" )
    public String getSaveRoot() {
        return saveRoot;
    }

    public void setSaveRoot(String saveRoot) {
        this.saveRoot = saveRoot;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TopicC topicC = (TopicC) o;

        if (id != topicC.id) return false;
        if (status != topicC.status) return false;
        if (addTime != null ? !addTime.equals(topicC.addTime) : topicC.addTime != null) return false;
        if (description != null ? !description.equals(topicC.description) : topicC.description != null) return false;
        if (excludeWords != null ? !excludeWords.equals(topicC.excludeWords) : topicC.excludeWords != null)
            return false;
        if (keywords != null ? !keywords.equals(topicC.keywords) : topicC.keywords != null) return false;
        if (name != null ? !name.equals(topicC.name) : topicC.name != null) return false;
        if (saveRoot != null ? !saveRoot.equals(topicC.saveRoot) : topicC.saveRoot != null) return false;
        if (startTime != null ? !startTime.equals(topicC.startTime) : topicC.startTime != null) return false;
        if (tableSuffix != null ? !tableSuffix.equals(topicC.tableSuffix) : topicC.tableSuffix != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (addTime != null ? addTime.hashCode() : 0);
        result = 31 * result + (startTime != null ? startTime.hashCode() : 0);
        result = 31 * result + status;
        result = 31 * result + (keywords != null ? keywords.hashCode() : 0);
        result = 31 * result + (excludeWords != null ? excludeWords.hashCode() : 0);
        result = 31 * result + (tableSuffix != null ? tableSuffix.hashCode() : 0);
        result = 31 * result + (saveRoot != null ? saveRoot.hashCode() : 0);
        return result;
    }
}
